#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
long long GCD(long long x, long long y) {
     if (!y) return 1ll;
     return GCD(y, x % y) + 1ll;
}
long long maxGCD(long long n) {
     long long ans = 0ll;
     for (long long i = 1; i <= n; i++)
         for (long long j = 1; j <= n; j++)
             ans = max(ans, GCD(i, j));
     return ans;
}
LL fib[120];
LL ans[maxn];
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  /*for(LL i=1;i<=100;i++){
    cout<<"i="<<i<<" "<<"maxGCD(i)"<<maxGCD(i)<<"\n";
  }*/

  fib[1]=1;fib[2]=1;
  ans[1]=2;ans[2]=3;
  for(LL i=3;i<=100;i++){
    fib[i]=fib[i-1]+fib[i-2];
    ans[i]=ans[i-1]+1;
  }
  LL n;cin>>n;
  for(LL i=1;i<=100;i++){
     n-=fib[i];
     if(n<=0){
        cout<<ans[i]<<"\n";
        break;
     }
  }
return 0;
}
